fix(guides): build OG images for all 504 posts (was 39)#2436
Conversation
…posts The build script ran 'generate-og-images' BEFORE 'build-content', so OG generation read the stale committed lib/content.ts (39 posts) instead of the freshly-built 504-post list. Result: only 39 of 504 guides had OG/Twitter images on the deployed site. Fix: run build-content first to regenerate lib/content.ts, then generate-og-images reads the up-to-date 504 posts. Verified locally: Built 504 posts and 29 categories Done — generated 1 root + 504 post OG images. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes the Guides app build pipeline so OG image generation runs against the freshly generated lib/content.ts (reflecting all posts) rather than the stale committed version, ensuring every guide gets an OG/Twitter image in static exports.
Changes:
- Reorders
apps/guidesbuild script to runbuild-contentbeforegenerate-og-images. - Ensures
generate-og-imagesreads the up-to-datepostslist vialib/mdx-static→lib/content.ts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Default vitest hook timeout is 5s; generating per-post PNGs takes 30-60s for the full set, so the beforeAll() that runs generate-og-images.ts was killed mid-run. Raising to 180s. Bundled with the build-order fix in this PR because the test only becomes meaningful once the build runs in the right order — with the prior order, the test still passed on the stale 39-post snapshot, masking the real bug. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The bug
apps/guides/package.jsonbuild script ran in the wrong order:generate-og-imagesruns first and readslib/content.ts. Butlib/content.tsis itself written by build-content fromcontent/posts/*.mdx. So OG generation saw the stale committed version oflib/content.ts(39 posts) instead of the freshly-built 504-post list.Visible in the CF Pages build log:
Built 504 posts and 29 categoriesDone — generated 1 root + 39 post OG images→ 465 of 504 guides shipped without OG/Twitter images.
The fix
One-line swap: run
build-contentfirst, thengenerate-og-images, thennext build.Verified locally
Follow-up
A hardening PR will follow with:
generate-og-imagescount matchesbuild-contentpost count